31 #ifndef goosememorymapH
32 #define goosememorymapH
78 void CalcScore(
int a_dist,
double a_flightcost,
int a_expectedforagingtime)
80 double cost = a_dist * a_flightcost;
122 bool MemDel(
int a_polyid);
152 bool ChangeSetFoodRes(
int a_polyid,
double a_grain,
double a_maize,
double a_grazing);
184 double CalcScore(
int a_dist,
double a_foodresource,
double a_threat);
A class to describe the goose base.
Definition: Goose_Base.h:132
a data structure to hold goose memory location attributes
Definition: GooseMemoryMap.h:42
double m_grazing
the grazing resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:57
GooseMemoryLocation()
GooseMemoryLocation default constructor.
Definition: GooseMemoryMap.h:69
double m_foodresource
The max food intake rate (kJ/min) at the location.
Definition: GooseMemoryMap.h:59
void CalcScore(int a_dist, double a_flightcost, int a_expectedforagingtime)
Updates the m_score value.
Definition: GooseMemoryMap.h:78
double m_maize
the maize resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:55
double m_grain
the grain resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:53
double m_score
A score used to assess the location.
Definition: GooseMemoryMap.h:63
int m_x
x-coordinate
Definition: GooseMemoryMap.h:47
bool operator<(const GooseMemoryLocation &gml)
operator definition for comparing polygon id numbers
Definition: GooseMemoryMap.h:73
int m_age
how old the memory is
Definition: GooseMemoryMap.h:45
double m_threat
the threat-level memory strength
Definition: GooseMemoryMap.h:61
int m_y
y-coordinate
Definition: GooseMemoryMap.h:49
static int m_infinitememorystop
the age at which a memory is removed.
Definition: GooseMemoryMap.h:65
bool ShouldDelete()
Test to see if a memory is too old to remember any longer.
Definition: GooseMemoryMap.h:85
int m_polygonid
the unique polygon identification
Definition: GooseMemoryMap.h:51
The class describing both local and seasonal goose memories and cognition.
Definition: GooseMemoryMap.h:94
Goose_Base * m_myOwner
pointer to the owner
Definition: GooseMemoryMap.h:97
GooseMemoryMap(Goose_Base *a_owner)
Constructor.
Definition: GooseMemoryMap.cpp:39
void GooseMemoryError(std::string a_str, int a_value)
Error message functionality.
Definition: GooseMemoryMap.cpp:341
double GetTotalThreats(void)
Get total of threat currently remembered.
Definition: GooseMemoryMap.cpp:323
bool ChangeMultThreat(int a_polyid, double a_threat)
Multiply threat at a memory location.
Definition: GooseMemoryMap.cpp:187
bool ChangeSetFoodRes(int a_polyid, double a_grain, double a_maize, double a_grazing)
Set food at a memory location.
Definition: GooseMemoryMap.cpp:159
double GetThreat(int a_polyid)
Get the threat level at location.
Definition: GooseMemoryMap.cpp:221
double GetFoodRes(int a_polyid)
Get the food resource at location.
Definition: GooseMemoryMap.cpp:206
bool ChangeMultFoodRes(int a_polyid, double a_foodres)
Multiply food at a memory location.
Definition: GooseMemoryMap.cpp:141
void DecayAllMemory()
Decay all memory.
Definition: GooseMemoryMap.cpp:295
double m_threatdecayrate
The decay rate per day for threats.
Definition: GooseMemoryMap.h:99
bool ChangeAddFoodRes(int a_polyid, double a_foodres)
Add to food at a memory location.
Definition: GooseMemoryMap.cpp:105
int m_expectedforagingtime
the time in minutes a goose expects to be able to forage when evaluating cost benefit of flying to a ...
Definition: GooseMemoryMap.h:101
GooseMemoryLocation GetBestFeedingScore()
Find the current best feeding location.
Definition: GooseMemoryMap.cpp:236
void ClearAllMemory(void)
Remove all memory.
Definition: GooseMemoryMap.cpp:335
void MemAdd(GooseMemoryLocation a_gml)
Add a new memory location.
Definition: GooseMemoryMap.cpp:50
std::vector< GooseMemoryLocation > m_memorylocations
The list of memory locations.
Definition: GooseMemoryMap.h:103
bool ChangeAddThreat(int a_polyid, double a_threat)
Add to threat at a memory location.
Definition: GooseMemoryMap.cpp:123
bool MemDel(int a_polyid)
Delete a memory location.
Definition: GooseMemoryMap.cpp:87
double CalcScore(int a_dist, double a_foodresource, double a_threat)
Inline function to calulate overall score for a distance, resource and threat.
Definition: GooseMemoryMap.cpp:273
~GooseMemoryMap()
Destructor.
Definition: GooseMemoryMap.h:110
bool IsKnownArea(int a_polyid)
Check if this location is known.
Definition: GooseMemoryMap.cpp:282